function VachiusaUtility()
	if PQI_VachiusaGeneral_RolePoll_enable then
		local rollcheckvisible = RolePollPopup:IsVisible()
		local specIndex = GetSpecialization()
		if specIndex then
			local _, _, _, _, _, specRole = GetSpecializationInfo(specIndex)
		end
		
		if rollcheckvisible 
		and specRole
		then
			if DelayCast(99994, PQI_VachiusaGeneral_DelayAcceptTime_value) then
				UnitSetRole("player", specRole)
				VAS_RunMacroText("/run RolePollPopup:Hide()")
				VAS_WriteToChat("\124cFFFF55FFAuto-accepted a RolePoll at " .. date("%H:%M:%S (%I:%M:%S %p) Local Time"))			
			end
		end
	end

	if PQI_VachiusaGeneral_RoleQueue_enable then
		local checkvisible = LFDRoleCheckPopup:IsVisible()
		local tank = LFDQueueFrameRoleButtonTank.checkButton:GetChecked()
		local healer = LFDQueueFrameRoleButtonHealer.checkButton:GetChecked()
		local dps = LFDQueueFrameRoleButtonDPS.checkButton:GetChecked()
		--RolePollPopup:IsVisible()
		
		if checkvisible 
		and (tank or healer or dps) 
		then
			if DelayCast(99992, PQI_VachiusaGeneral_DelayAcceptTime_value) then
				LFDRoleCheckPopupAccept_OnClick()
				VAS_RunMacroText("/run LFDRoleCheckPopup:Hide()")
				VAS_WriteToChat("\124cFFFF55FFAuto-accepted a RoleQueue at " .. date("%H:%M:%S (%I:%M:%S %p) Local Time"))			
			end
		end
	end

	if PQI_VachiusaGeneral_JoinQueue_enable then
		if LFGDungeonReadyPopup:IsVisible() 
		--or StaticPopup1:IsVisible() 
		then
			if DelayCast(99991, PQI_VachiusaGeneral_DelayAcceptTime_value) then
				VAS_WriteToChat("\124cFFFF55FFAuto-accepted a JoinQueue at " .. date("%H:%M:%S (%I:%M:%S %p) Local Time"))							
				VAS_AcceptProposal() 
				VAS_RunMacroText("/run LFGDungeonReadyPopup:Hide()")	
				--VAS_RunMacroText("/run StaticPopup1:Hide()")	
			end
		end
	end

	if PQI_VachiusaGeneral_ReadyCheck_enable then
		if ReadyCheckFrame:IsVisible() 
		then
			if DelayCast(99993, PQI_VachiusaGeneral_DelayAcceptTime_value) then
				VAS_RunMacroText("/run ConfirmReadyCheck(1);ReadyCheckFrame:Hide()")				
				VAS_WriteToChat("\124cFFFF55FFAuto-accepted a Ready Check at " .. date("%H:%M:%S (%I:%M:%S %p) Local Time"))							 
			end
		end
	end

	if PQI_VachiusaGeneral_Resurect_enable then
		local bres = true 
		
		--if RESURRECT:IsVisible() 
		--or RESURRECT_NO_TIMER:IsVisible() 
		--or RESURRECT_NO_SICKNESS:IsVisible() 
		--if event == "RESURRECT_REQUEST" 
		if ResurrectGetOfferer() 
		--or ResurrectHasSickness()
		and not ResurrectHasTimer() 
		--or GetCorpseRecoveryDelay() == 0
		then
			if (GetCorpseRecoveryDelay() == 0) then
				if ((UnitAffectingCombat("target")) and bres) or not (UnitAffectingCombat("target")) then
					if DelayCast(99995, PQI_VachiusaGeneral_DelayAcceptTime_value) then
						VAS_WriteToChat("\124cFFFF55FFAuto-accepted a Resurect at " .. date("%H:%M:%S (%I:%M:%S %p) Local Time"))							
						AcceptResurrect();
						StaticPopup_Hide("RESURRECT_NO_TIMER");
						--VAS_RunMacroText("/run RESURRECT:Hide();RESURRECT_NO_TIMER:Hide();RESURRECT_NO_SICKNESS:Hide()")
					end
				end
			end
		end
	end

	if PQI_VachiusaGeneral_Summon_enable then
		--if CONFIRM_SUMMON:IsVisible() 
		--if event == "CONFIRM_SUMMON"
		if PlayerCanTeleport()
		and GetSummonConfirmTimeLeft() > 0
		--or GetSummonConfirmSummoner() 
		--or GetSummonConfirmAreaName()
		and not UnitAffectingCombat("player")
		then
			if DelayCast(99996, PQI_VachiusaGeneral_DelayAcceptTime_value) then
				VAS_WriteToChat("\124cFFFF55FFAuto-accepted a Summon at " .. date("%H:%M:%S (%I:%M:%S %p) Local Time"))							
				ConfirmSummon()
				StaticPopup_Hide("CONFIRM_SUMMON")
			end
		end
	end

	if PQI_VachiusaGeneral_FollowTanks_enable then
		if not HaveTank then
			function HaveTank()
				if IsInRaid() then
						group = "raid"
				elseif IsInGroup() then
						group = "party"
				end		
				if not UnitExists("focus") 
				and group then
					for i = 1, GetNumGroupMembers() do 
						local member = group..i
						if not UnitIsDeadOrGhost(member) then
							if UnitGroupRolesAssigned(member) == "TANK" 
							--and not UnitIsCharmed(member) 
							and UnitInRange(member) 
							and UnitIsConnected(member)
							and UnitCanCooperate("player",member) 
							and not VAS_IsOutOfSight(member) then    				
								return member 											
							end
						end
					end
				else
					if UnitExists("focus")			
					and not UnitIsDeadOrGhost("focus")							
					--and not UnitIsCharmed("focus") 
					and UnitInRange("focus") 
					and UnitIsConnected("focus")
					and UnitCanCooperate("player","focus")			
					and not VAS_IsOutOfSight("focus") then
						member = "focus"
						return member
					end		
				end	   			
			end
		end
		
		if HaveTank() then		
			local px,py = GetPlayerMapPosition("player")
			local tx,ty = GetPlayerMapPosition(HaveTank())
			local angle = floor ( ( math.pi - math.atan2(px-tx,ty-py) - GetPlayerFacing() ) / (math.pi*2) * 32 + 0.5 ) % 32
			local dwt = VAS_UnitDistance(HaveTank(),"player")
			--local dwt = CheckInteractDistance(HaveTank(), 4) 	

		    if dwt   
		    and not IsMouselooking()   
		    then    	
				if dwt < PQI_VachiusaGeneral_FollowTanks_value then     
				MoveForwardStop()
			end
		    end
				
			if not IsMouselooking() 
			and px ~= 0 
			and tx ~= 0 then		
				if angle > 0 
				and angle < 16 then 
					TurnLeftStart() 				
				end
				if angle > 15 
				and angle < 31 then 
					TurnRightStart() 				
				end
			if angle == 31 
			or angle == 0 then 
				TurnRightStop() TurnLeftStop() 	      		
				if dwt 
				and not UnitChannelInfo("player") 
				and not UnitCastingInfo("player") 
				then
					if dwt >= PQI_VachiusaGeneral_FollowTanks_value then       				
							if GetNumCompanions("MOUNT") > 0 then
								local isFlyable = IsFlyableArea()
								--local isFlying = IsFlying()
								--local isSwimming = IsSwimming()   
								local mounted = IsMounted()						   				
							local speed, groundSpeed, flightSpeed, swimSpeed = GetUnitSpeed(HaveTank())	      				  		
							local m,t,f="mount",{{},{}} 			
							for i=2,GetNumCompanions(m) do 
								tinsert(t[bit.band(2,select(6,GetCompanionInfo(m,i)))==0 and 1 or 2],i) 
								end
								local f=isFlyable and 2 or 1 	      				
							local mountid = t[f][random(#t[f])]
							if not UnitAffectingCombat("player") 
							and not UnitAffectingCombat(HaveTank()) then
								if speed 
								--and DelayCast(99995, 1.0) 		      		
								--and VAS_SpellAvailable(mountid) 		
								and not mounted	then 		      				
									if speed > 7 then --Normal Running: 7
										--random mount
										--CastSpellByName(tostring(GetSpellInfo(mountid),nil))	
										CallCompanion(m, mountid) 
									end
								end
							else
									--Dismount()
									DismissCompanion(m)
							end
						end      				
						MoveForwardStart() 	  
					end    			
				else 
					MoveForwardStop() 
				end
			end
			manualcontrol = false
			end
		end
			
		if not manualcontrol 
		and IsMouselooking() then
			manualcontrol = true 
			MoveForwardStop() 
			TurnRightStop() 
			TurnLeftStop() 
		end
	end
end